package com.kingint.sendcarda;

public class Result {
    private int code = -1;

    private Object data;

    private String message;


    public Object getData(){
        return this.data;
    }

    public int getCode(){
        return this.code;
    }




    public static Result ok() {
        Result result = new Result();
        result.code = 0;
        return result;
    }

    public static Result ok(Object data) {
        Result result = new Result();
        result.code = 0;
        result.data = data;
        return result;
    }

    public static Result load() {
        Result result = new Result();
        result.code = 101;
        return result;
    }

    public static Result error(int code,String message) {
        Result result = new Result();
        result.code = code;
        result.message = message;
        return result;
    }

    public Result setCode(int code) {
        this.code = code;
        return this;
    }

    public Result setData(Object data) {
        this.data = data;
        return this;
    }

    public Result setMessage(String message) {
        this.message = message;
        return this;
    }
}
